from rest_framework.viewsets import ModelViewSet
from meiduo_mall_admin.my_paginate import MyPageNumberPagination
from django.contrib.auth.models import Permission, Group
from . import group_permission_serializer
from rest_framework.generics import ListAPIView


class GroupsPermissionViews(ModelViewSet):
    pagination_class = MyPageNumberPagination
    serializer_class = group_permission_serializer.GroupsPermissionSerializer
    queryset = Group.objects.order_by("id").all()


class PermissionGroupViews(ListAPIView):
    serializer_class = group_permission_serializer.PermissionGroupSerializer
    queryset = Permission.objects.all()

    pass